#ifndef PATCHCOMPONENT_H
#define PATCHCOMPONENT_H
#include "StompedReality/Core.h"
#include "StompedReality/Core/Component.h" // Base class: stomped_reality::entity_system::Component
#include "StompedReality/Math/Vector2.h"

StaticRegDummy( PatchComponent )

namespace StompedReality
{
namespace components
{

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Joint component type helper
 */
struct PatchComponentReg
{
  static int registeType( );
};

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Patch component.
 *
 *    Stores and sends patch information to the renderer<br>
 *    Send order:
 *     - send patch id
 */
class DLL_EXPORT PatchComponent : public StompedReality::Core::Component
{
  friend struct PatchComponentReg;

 protected:

  StompedReality::Math::Vector2 m_Offset;
  StompedReality::ID m_PatchID;

 public:

  PatchComponent( );
  ~PatchComponent( );

 public:

  //! \brief	Draw function.
  //!   Sends the render information to the renderer.
  void Draw( );

  //! \brief	Exectuted after creation
  void OnCreation( );

  //! \brief	Exectuted before destruction
  void OnDestruction( );

  //! \brief	Exectuted afte values read by TypeSystem.
  //!			Initialzies the component.
  //! \param	constructionHelper The contruction helper.
  void InitializeComponent( StompedReality::Core::ComponentConstuctionHelper* constructionHelper );

  //! \brief	Processes a message.
  //! \param	msg The message.
  bool ProcessMessage ( StompedReality::Core::Message* msg );

  //! \brief	Update.
  void Update ( );

  //! \brief	PatchId setter.
  void SetPatchID ( StompedReality::ID patchID );

  //! \brief	PatchId getter.
  StompedReality::ID GetPatchID( );
};

}
}
#endif // PATCHCOMPONENT_H
